#include<iostream>
#include<string>
using namespace std;
class Cstudent{
	private:
		int reg_num;
		std::string name;
		double shu,ying,ji;
	public:
		Cstudent(int r,std::string n,double s,double y,double j)
		: reg_num(r),name(n),shu(s),ying(y),ji(j) {		cout<<"构造函数被调用"<<endl;}
		~Cstudent()
		{
			cout<<"析构函数被调用"<<endl;
		}
		double sum(){
			return shu+ying+ji;
		}
		double average(){
			return sum()/3;
		}
		void print(){
			cout<<"注册号"<<reg_num<<endl;
			cout<<"姓名:"<<name<<endl;
			cout<<"数学成绩：:"<<shu<<endl;
			cout<<"英语成绩：:"<<ying<<endl;
			cout<<"计算机成绩:"<<ji<<endl;
			cout<<"总成绩"<<sum()<<",平均成绩：:"<<average()<<endl;
			}
		int get_reg_num(){
			return reg_num;
		}
};
int main()
{
	int i;
	Cstudent students[3]={Cstudent(1,"邹",90,85,75),Cstudent(2,"继",80,82,78),Cstudent(3,"武",80,76,98)
	};
	for(i=0;i<3;i++)
	{
		students[i].print();
		std::cout<<std::endl;
	}
	return 0;
}